using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Waterhammer : Creation
{
    public float CD;
    float CDtime;
    Transform transform;
    public GameObject waterhammer;
    void Start()
    {
        //enemyattack= attackobject.GetComponent<EnemyAttack> ();
        //face = enemyattack.face;
        transform = GetComponent<Transform>();
        CDtime = CD;
        health = 500;
    }
    public override void TakeDamage(float damage)
    {
        health -= damage;
        if (health <= 0)
            Destroy(gameObject);
    }
    // Update is called once per frame
    void Update()
    {
        if (CDtime > 0)
        {
            CDtime -= Time.deltaTime;
        }
        else
        {
            CDtime = 10000;
            Vector3 vector = transform.position;
            vector.y = -20.6f;
            Instantiate(waterhammer, vector, Quaternion.identity);
        }
    }
}
